extends Node2D

@onready var node_2d: Node2D = $CanvasLayer/Node2D

@onready var color_rect: ColorRect = $CanvasLayer/ColorRect
@onready var character_body_2d: CharacterBody2D = $CharacterBody2D
@onready var talk_01: Area2D = $Talk01

signal start_mind01(kind : int , part : int)
signal start_talk01(kind : int , part : int)

func _ready() -> void:
	var fade_tween = create_tween()
	fade_tween.tween_property(color_rect , "modulate:a" , 0 , 3.0)
	await fade_tween.finished
	character_body_2d.is_game_start = true
	start_mind01.emit(1,1)


func _on_mind_03_body_entered(body: Node2D) -> void:
	start_talk01.emit(0,0)
	talk_01.queue_free()


func _on_bed_body_entered(body: Node2D) -> void:
	character_body_2d.is_game_start = false
	var fade_tween = create_tween()
	fade_tween.tween_property(color_rect , "modulate:a" , 1 , 3.0)
	await fade_tween.finished
	node_2d.visible = true
	
